package cn.zye.msa.db;

import java.util.ArrayList;
import java.util.List;

public class companyPO {
	String id;
	String name;
	String ctype;
	String state;
	String citys;
	String tel;
	String corg;
	String levels;
	String types;
	String countrys;
	String address1;
	public String getLevels() {
		return levels;
	}

	public void setLevels(String levels) {
		this.levels = levels;
	}

	public String getTypes() {
		return types;
	}

	public void setTypes(String types) {
		this.types = types;
	}

	public String getCountrys() {
		return countrys;
	}

	public void setCountrys(String countrys) {
		this.countrys = countrys;
	}

	public String getAddress1() {
		return address1;
	}

	public void setAddress1(String address1) {
		this.address1 = address1;
	}

	public String getCorpor() {
		return corpor;
	}

	public void setCorpor(String corpor) {
		this.corpor = corpor;
	}

	public String getRegdate() {
		return regdate;
	}

	public void setRegdate(String regdate) {
		this.regdate = regdate;
	}

	public String getPostcode() {
		return postcode;
	}

	public void setPostcode(String postcode) {
		this.postcode = postcode;
	}

	public String getFax() {
		return fax;
	}

	public void setFax(String fax) {
		this.fax = fax;
	}

	public String getUrl() {
		return url;
	}

	public void setUrl(String url) {
		this.url = url;
	}

	public String getEmail() {
		return email;
	}

	public void setEmail(String email) {
		this.email = email;
	}

	public String getCreateuser() {
		return createuser;
	}

	public void setCreateuser(String createuser) {
		this.createuser = createuser;
	}

	public String getCreatedate() {
		return createdate;
	}

	public void setCreatedate(String createdate) {
		this.createdate = createdate;
	}

	public String getCounts() {
		return counts;
	}

	public void setCounts(String counts) {
		this.counts = counts;
	}

	String corpor;
	String regdate;
	String postcode;
	String fax;
	String url;
	String email;
	String createuser;
	String createdate;
	String counts;
	int onlinenum;
	int shipnum;
	List<ais_ship_po> shipList;

	public ais_ship_po findShip(String txt) {
		ais_ship_po p = null;
		if (shipList != null) {
			for (ais_ship_po po : shipList) {
				if (po.getCn().equals(txt) || po.getEn().equals(txt)
						|| po.getMmsi().equals(txt)) {
					p = po;
					break;
				}
			}
		}
		return p;
	}

	public List<ais_ship_po> searchShip(String txt) {
		List<ais_ship_po> ps = new ArrayList<ais_ship_po>();
		if (shipList != null) {
			for (ais_ship_po po : shipList) {
				if (po.getCn().contains(txt) || po.getEn().contains(txt)
						|| po.getMmsi().contains(txt)) {
					ps.add(po);
				}
			}
		}
		return ps;
	}

	public String shipListToString() {
		String s = "";
		if (this.shipList != null && this.shipList.size() > 0) {
			for (int i = 0; i < this.shipList.size(); i++) {
				ais_ship_po po = shipList.get(i);
				String title = "";
				if (po.getCn() != null && po.getCn().length() > 0) {
					title = po.getCn();
				} else if (po.getEn() != null && po.getEn().length() > 0) {
					title = po.getEn();
				} else {
					title = po.getMmsi();
				}
				s += title;
				if (i + 1 <= shipList.size()) {
					s += ",";
				}
			}
		}
		return s;
	}

	public List<ais_ship_po> getShipList() {
		return shipList;
	}

	public void setShipList(List<ais_ship_po> shipList) {
		this.shipList = shipList;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public int getOnlinenum() {
		return onlinenum;
	}

	public void setOnlinenum(int onlinenum) {
		this.onlinenum = onlinenum;
	}

	public int getShipnum() {
		return shipnum;
	}

	public void setShipnum(int shipnum) {
		this.shipnum = shipnum;
	}

	public String getId() {
		return id;
	}

	public void setId(String id) {
		this.id = id;
	}

	public String getCtype() {
		return ctype;
	}

	public void setCtype(String ctype) {
		this.ctype = ctype;
	}

	public String getState() {
		return state;
	}

	public void setState(String state) {
		this.state = state;
	}

	public String getCitys() {
		return citys;
	}

	public void setCitys(String citys) {
		this.citys = citys;
	}

	public String getTel() {
		return tel;
	}

	public void setTel(String tel) {
		this.tel = tel;
	}

	public String getCorg() {
		return corg;
	}

	public void setCorg(String corg) {
		this.corg = corg;
	}
}
